package grpc

import (
	"datum_user/proto"
	"github.com/micro/go-micro/v2"
	"github.com/micro/go-micro/v2/registry"
	"github.com/micro/go-micro/v2/registry/etcd"
)

var microService micro.Service

func init()  {
	service := micro.NewService(
		micro.Name("datum.user.client"),
		micro.Registry(
			etcd.NewRegistry(
				registry.Addrs("47.116.73.130:2379"),
			),
		),
	)
	microService = service
}

func GetClientService() micro.Service {
	return microService
}

func GetTokenService() proto.TokenService {
	return proto.NewTokenService("client.token",GetClientService().Client())
}

func GetSmsService() proto.SmsService {
	return proto.NewSmsService("client.sms",GetClientService().Client())
}
